[super init] and loading NIB / XIB files?

Posted by fuzzygoat on Stack Overflow See other posts from Stack Overflow or by fuzzygoat
Published on 2010-06-01T16:49:57Z Indexed on 2010/06/01 16:53 UTC
Read the original article Hit count: 183

Filed under:
|
|

I am a little curious, I have a view controller class and an NIB/XIB (both are named "MapViewController") If I do the following it loads the NIB with the matching name.

-(id)init {
    self = [super initWithNibName:@"MapViewController" bundle:nil];
    if(self) {
        do things ...
    }
    return self;
}

if on the other hand I just specify [super init] does Xcode just look for a NIB that matches the name of the controller, is that how this is working?

-(id)init {
    self = [super init];
    if(self) {
        do things ...
    }
    return self;
}

cheers Gary.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c